package com.zj;

import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;

public class TestMain2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //测试 文件读取
        String path=System.getProperty("user.home");
        path=path+ File.separator+"product_resource"+File.separator+"UK Advanced Cryptics Dictionary.txt";
        List<String> list = new WordsLoader().load(path);
        System.out.println("词汇表总量"+list.size());

        Date start=new Date();

        String word="sdt";
        BestMatchingData result=BestMatchingConcurrentCalculation.getBestMatchingData(word,list  );
        Date end=new Date();
        int minDistance=result.getDistance();
        List<String> words=result.getWords();
        System.out.println("最短编辑距离"+minDistance);
        for (String w:words){
            System.out.print(w+"\t");
        }
        System.out.println("执行时间+"+(end.getTime()-start.getTime()));
    }
}
